package com.example.demo.controller;

import java.util.List;
import com.example.demo.bean.Person;
// import com.example.demo.service.PersonService;
import com.example.demo.mapper.PersonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private PersonMapper mapper;
    // private PersonService service;

    @RequestMapping("/hello")
    public List<Person> hello(){
        // Person person = new Person("zhangSan", 18);
        // List<Person> list = service.getAll();
        List<Person> list = mapper.selectAll();
        return list;
    }
}
